package Arrays;

//                                          Arrays.toString()
public class Test1 {
    //模拟实现Arays.toString
    public static void toSring(int[] arr){
        String result = "[";
        int i = 0;
        for (i = 0; i < arr.length; i++){
            result += arr[i];
            if (i < arr.length - 1){
                result += ", ";
            }
        }
        result += ']';
        System.out.println(result);
    }
    public static void main(String[] args) {
        int[] arr1 = new int[]{1, 2, 3};
        toSring(arr1);
    }
}
